package cn.com.sparkle.paxos.net.protocolprocessor;

import cn.com.sparkle.paxos.net.frame.FrameBody;

public abstract class AbstraceProtocol implements Protocol {
	private ProtocolProcessor<FrameBody> serverInProcessorChain;
	private ProtocolProcessor<FrameBody> userInProcessorChain;
	private ProtocolProcessor<FrameBody> clientReceiveProcessor;

	public AbstraceProtocol(ProtocolProcessor<FrameBody> serverInProcessorChain, ProtocolProcessor<FrameBody> userInProcessorChain,
			ProtocolProcessor<FrameBody> clientReceiveProcessor) {
		super();
		this.serverInProcessorChain = serverInProcessorChain;
		this.userInProcessorChain = userInProcessorChain;
		this.clientReceiveProcessor = clientReceiveProcessor;
	}

	@Override
	public ProtocolProcessor<FrameBody> getServerInProcessor() {
		return this.serverInProcessorChain;
	}

	@Override
	public ProtocolProcessor<FrameBody> getUserInProcessor() {
		return this.userInProcessorChain;
	}

	@Override
	public ProtocolProcessor<FrameBody> getClientReceiveProcessor() {
		return this.clientReceiveProcessor;
	}

	protected void setServerInProcessorChain(ProtocolProcessor<FrameBody> serverInProcessorChain) {
		this.serverInProcessorChain = serverInProcessorChain;
	}

	protected void setUserInProcessorChain(ProtocolProcessor<FrameBody> userInProcessorChain) {
		this.userInProcessorChain = userInProcessorChain;
	}

	protected void setClientReceiveProcessor(ProtocolProcessor<FrameBody> clientReceiveProcessor) {
		this.clientReceiveProcessor = clientReceiveProcessor;
	}

}
